from selenium import webdriver
from selenium.webdriver.common.by import By

##提供键盘按键的支持，比如：RETURN, F1, ALT等
from selenium.webdriver.common.keys import Keys  


driver = webdriver.Firefox()
driver.get("http://106.38.235.201:7080/cas/login")
driver.find_element(By.ID,"username").send_keys("43132220201")
driver.find_element(By.ID,"password").send_keys("Tmxczx@1234")

image = driver.find_element_by_xpath('//*[@id="root"]/div/div/div/div/div[2]/div[3]/div[1]/div[2]/img')
image = image.get_attribute('src')  # 获取当前验证码图片链接
imageCaptchaValue = readImage(image)  # 这里的readImage是用来给打码平台发送请求的方法，需要根据自己的实际情况去实现这个方法
captchaValue = driver.find_element_by_xpath('//*[@id="root"]/div/div/div/div/div[2]/div[3]/div[1]/input')  # 验证码输入框
captchaValue.send_keys(imageCaptchaValue)  # 填入验证码
